<?php
/**
 * Date: 2024.8
 * Author: kahn
 * 苹果内支付
 */
use config\Response;
use service\vip\OrderService;
class IapController extends Controller
{

    /**
     * @desc 苹果内支付查询订单
     */
    public function receiptAction(): void
    {
        $orderId = $this->_getParam('orderId','intval');
        $receipt = $this->_getParam('receipt','string');

        $ret = OrderService::appleReceipt($this->userId, $orderId, $receipt);

        if(!$ret){ //非法订单
            $this->_response(Response::SYSTEM_ERROR);
        }

        $this->_response(Response::SUCCESS, array('status'=>'paid'));

    }

}

